<?php 
    echo $currentDateTime = date('Y-m-d H:i:s');
    phpinfo();
?>
<br />

<?php
    // 数据库连接参数
    $host = 'localhost';
    $port = '9306';
    $dbname = 'group13';
    $username = 'example_user';
    $password = 'example_password';

    // 创建连接
    $conn = new mysqli($host, $username, $password, $dbname, $port);

    // 检查连接是否成功
    if ($conn->connect_error) {
        die("Connection failed: " . $conn->connect_error);
    }

    // 执行查询
    $query = "SELECT * FROM Product";
    $result = $conn->query($query);

    // 处理查询结果
    if ($result->num_rows > 0) {
        while ($row = $result->fetch_assoc()) {
            // 处理每一行的数据
            echo "Product ID: {$row['product_id']}, Name: {$row['name']}, Price: {$row['price']}<br>";
        }
    } else {
        echo "No products found.";
    }

    // 关闭连接
    $conn->close();
?>
